import {
	stringify
} from 'qs'

// 用户注册 /memberService/member/initMember
export const register = (params) => {
	return uni.$request(`/memberService/member/initMember`, params, 'POST', {
		// AcceptLanguage: locale.value
	})
}

// 获取用户信息 /memberService/member/getUserInfo
export const getUserInfo = (params) => {
	return uni.$request(`/memberService/member/getUserInfo`, params, 'GET')
}

//获取用户资产 /memberService/account/getCurrencyBalance
export const getCurrencyBalance = (params) => {
	return uni.$request(`/memberService/account/getCurrencyBalance`, params, 'GET')
}

//获取市场列表 /memberService/account/getMarket
export const getMarket = (params) => {
	return uni.$request(`/memberService/account/getMarket`, params, 'GET')
}

//划转 /memberService/account/transfer
export const postTransfer = (params) => {
	return uni.$request(`/memberService/account/transfer?${stringify(params)}`, params, 'POST')
}

//获取用户资金流水 /memberService/account/queryBalanceFlow
export const getQueryBalanceFlow = (params) => {
	return uni.$request(`/memberService/account/queryBalanceFlow`, params, 'GET')
}

//获取交易对 /trade-service/currency/getPairs
export const getPairs = (params) => {
	return uni.$request(`/tradeService/currency/getPairs`, params, 'GET')
}

//交易创建订单 /tradeService/order/createOrder
export const postCreateOrder = (params) => {
	return uni.$request(`/tradeService/order/createOrder`, params, 'POST')
}

//查询委托单 /tradeService/order/queryOrder
export const getQueryOrder = (params) => {
	return uni.$request(`/tradeService/order/queryOrder`, params, 'GET')
}

//查询成交单 /tradeService/order/queryTrade
export const getQueryTrade = (params) => {
	return uni.$request(`/tradeService/order/queryTrade`, params, 'GET')
}

//查询历史委托 /tradeService/order/queryHistoryOrder
export const queryHistoryOrder = (params) => {
	return uni.$request(`/tradeService/order/queryHistoryOrder`, params, 'GET')
}

//查询主流 /tradeService/currency/getIndex
export const getIndex = (params) => {
	return uni.$request(`/tradeService/currency/getIndex`, params, 'GET')
}

//交易K线图
export const getKline = (params) => {
	return uni.$request(`/tradeService/currency/getKline`, params, 'GET')
}

//获取盘口数据
export const queryTradeDex = (params) => {
	return uni.$request(`/tradeService/order/queryTradeDex`, params, 'GET')
}

//查询机器人列表
export const queryRobot = (params) => {
	return uni.$request(`/robotService/robot/queryRobot`, params, 'GET')
}

//查询自己的机器人
export const queryRobotFlow = (params) => {
	return uni.$request(`/robotService/robot/queryRobotFlow`, params, 'GET')
}

//查首页机器人展示
export const queryRobotProfit = (params) => {
	return uni.$request(`/robotService/robot/queryRobotProfit`, params, 'GET')
}

//参与机器人
export const postcreateRobot = (params) => {
	return uni.$request(`/robotService/robot/createRobot?${stringify(params)}`, params, 'POST')
}


//用户充值 /walletService/wallet/inBalance
export const inBalance = (params) => {
	return uni.$request(`/walletService/wallet/inBalance?${stringify(params)}`, params, 'GET')
}

//用户提现 /walletService/wallet/outBalance
export const outBalance = (params) => {
	return uni.$request(`/walletService/wallet/outBalance?${stringify(params)}`, params, 'POST')
}

//获取社区信息 /robotService/robot/getMemberTeam
export const getMemberTeam = (params) => {
	return uni.$request(`/robotService/robot/getMemberTeam`, params, 'GET')
}


//资讯列表 /memberService/content/getContent
export const getContent = (params) => {
	return uni.$request(`/memberService/content/getContent`, params, 'GET')
}

//撤单 /tradeService/order/cancalOrder
export const cancalOrder = (params) => {
	return uni.$request(`/tradeService/order/cancalOrder?${stringify(params)}`, params, 'POST')
}

//获取币种信息 /walletService/wallet/getcurrencyCode
export const getcurrencyCode = (params) => {
	return uni.$request(`/walletService/wallet/getcurrencyCode`, params, 'GET')
}